package kk.service;

import kk.domain.Orders;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

public interface OrdersService {
    /**
     * 查询所有订单
     * @return
     */
    public List<Orders> findAll() throws Exception;

    /**
     * 分页查询
     * @param pageNum
     * @param pageSize
     * @return
     * @throws Exception
     */
    public List<Orders> findAll(int pageNum,int pageSize) throws Exception;

    /**
     * 根据id查询订单及其详情信息
     * @param id
     * @return
     * @throws Exception
     */
    public Orders findById(Integer id)throws Exception;

    /**
     * 查询一个订单信息
     * @param id
     * @return
     * @throws Exception
     */
    public Orders findOneOrder(Integer id) throws Exception;

    /**
     * 根据产品id删除相应的订单
     * @param pid
     */
    public void deleteByProductId(Integer pid) throws Exception;

    /**
     * 根据会员的id删除相应订单
     * @param mid
     * @throws Exception
     */
    public void deleteByMemberId(Integer mid) throws Exception;

    /**
     * 根据订单的id删除订单
     * @param oid
     * @throws Exception
     */
    public void deleteById(Integer oid) throws Exception;

    /**
     * 更改订单信息
     * @param orders
     * @throws Exception
     */
    public void update(Orders orders) throws Exception;

    /**
     * 添加新的订单
     * @throws Exception
     */
    public void add(String orderNum,Date orderTime, Integer peopleCount, String orderDesc, Integer payType, Integer orderStatus,
                    Integer productId,
                    String member_name, String member_nickname, String member_phoneNum, String member_email,
                    String traveller_name, String traveller_sex, String traveller_phoneNum, Integer credentialsType, String credentialsNum, Integer travellerType) throws Exception;


    /**
     * 根据订单编号模糊查询
     * @param orderNum
     * @param pageNum
     * @param pageSize
     * @return
     */
    public List<Orders> findByOrderNum(String orderNum,Integer pageNum,Integer pageSize);
}
